package com.wancaijinfu.parse;



import org.json.JSONException;
import org.json.JSONObject;

import android.util.Log;

import com.wancaijinfu.javabean.UserData;

public class RegisterParse extends PostParse {

	@Override
	Object parseSuccess(JSONObject object) throws JSONException {
		
		Log.e("msg", object+"");
		
		
		JSONObject obj = object.getJSONObject("user");
		UserData user = new UserData();
		
		user.name = obj.getString("USERNAME");
		user.id = obj.getString("id");
	//	user.COOKIE = "login_user_id="+user.id;
		if(obj.has("avatar"))
		user.head = obj.getString("avatar");
		if(obj.has("sex"))
		user.sex=obj.getString("sex");
		//user.password = obj.getString("LOGINPASSWORD");		
		return user;
	}
}
